#include<iostream>
#include<vector>
#include<string>
using namespace std;
class TheTower
{
public:
    vector <int> count(vector <int> x, vector <int> y)
    {
    	int i,j;
    	int size = x.size();
    	vector<int> z;
    	int sumx=0;
    	int sumy=0;
    	int sum;
    	for(i=0;i<size-1;i++)
    	{
    		sum=0;
    		sumx += x[i];
    		int tmp = sumx/(i+1);
    		for(j=0;j<=i;j++)
    		{
    			if(tmp>=x[j])
    				sum+=tmp-x[j];
    			else
    				sum+=x[j]-tmp;
    		}
    		sumy += y[i];
    		tmp = sumy/(i+1);
    		for(j=0;j<=i;j++)
    		{
    			if(tmp>=y[i])
    				sum+=tmp-y[i];
    			else
    				sum+=y[i]-tmp;
    		}
    		z.push_back(sum);
    	}
    	return z;
    }
};

